//
//  TKAuctioneerManagementController.m
//  Ticket
//
//  Created by 小禹宝宝 on 2017/10/27.
//  Copyright © 2017年 cy55. All rights reserved.
//

#import "TKAuctioneerManagementController.h"
#import "TKAuctioneerManagementListController.h"
@interface TKAuctioneerManagementController ()
@property (nonatomic, strong) TKAuctioneerManagementListController *jingpaizhongController;
@property (nonatomic, strong) TKAuctioneerManagementListController *yixiajiaController;

@end

@implementation TKAuctioneerManagementController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"卖家拍品管理";
    [self ks_setupLeftBackBarButtonItemWithColor:nil];
    self.jingpaizhongController = [[TKAuctioneerManagementListController alloc] init];
    self.jingpaizhongController.listType = TKAuctioneerListTypeShangjia;
    self.yixiajiaController = [[TKAuctioneerManagementListController alloc] init];
    self.yixiajiaController.listType = TKAuctioneerListTypeXiajia;

    
    [self.segmentedPager bl_defaultConfig];
    //    The padding from the top, left, right, and bottom of the segmentedControl
    self.segmentedPager.segmentedControlEdgeInsets = UIEdgeInsetsMake(0, 50, 0, 50);
    
    //        [self testRequest_DirectGetOrPost];
    
}



- (void)testRequest_DirectGetOrPost {
    
    DDLogVerbose(@"测试请求:%@",URL_test);
    NSDictionary *parameters = @{@"goods_id":@"9"};
    [BLApi GET:URL_GoodsDetail_info parameters:parameters decodeClass:nil completion:^(id responseObject, id responseDataOriginal, NSError *error) {
        DDLogInfo(@"URL_goodsinfo_get-responseObject:%@", responseDataOriginal);
    }];
    
}



#pragma mark <MXSegmentedPagerControllerDataSource>

- (CGFloat)heightForSegmentedControlInSegmentedPager:(MXSegmentedPager *)segmentedPager {
    return 51;
}

- (NSInteger)numberOfPagesInSegmentedPager:(MXSegmentedPager *)segmentedPager {
    return 2;
}

- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {
    if (index == 0) {
        return @"竞拍中";
    } else  {
        return @"已下架";
    }
}


- (UIViewController *)segmentedPager:(MXSegmentedPager *)segmentedPager viewControllerForPageAtIndex:(NSInteger)index {
    if (index == 0) {
        return self.jingpaizhongController;
    }  else {
        return self.yixiajiaController;
    }
}

- (void)segmentedPager:(MXSegmentedPager *)segmentedPager didSelectViewWithIndex:(NSInteger)index {
    //    self.rightBtn.hidden = index == 0;
}


@end
